From: Eli Zaretskii Date: Fri, 27 Mar 2009 18:34:03 +0000 (+0000) Subject: (ls-lisp-insert-directory): Allow for a trailing '/' when looking for "." X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~421^2~1067 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=f13206ef5c74544bb0ebfbe7061f8f37862b5496;p=emacs.git (ls-lisp-insert-directory): Allow for a trailing '/' when looking for "." and "..". (Bug#2801) --- diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 0374b9bbaed..060e4011a4a 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -390,7 +390,10 @@ not contain `d', so that a full listing is expected." (setq elt (car file-alist) file-alist (cdr file-alist)) (when (and (eq (cadr elt) t) ; directory - (not (string-match "\\`\\.\\.?\\'" (car elt)))) + ;; Under -F, we have already decorated all + ;; directories, including "." and "..", with + ;; a /, so allow for that as well. + (not (string-match "\\`\\.\\.?/?\\'" (car elt)))) (setq elt (expand-file-name (car elt) dir)) (insert "\n" elt ":\n") (ls-lisp-insert-directory